package com.cy4;

import java.util.*;
public class Solution {
    public void merge(int a[], int m, int b[], int n) {
        a=Arrays.copyOf(a, m+n);
        int k=0;
        for(int i=m;i<(m+n);i++){
            a[i]=b[k++];
        }
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));

    }

    public static void main(String[] args) {
        int[] b = {1, 2, 3};
        int[] a = {4, 5, 6};
        Solution solution = new Solution();
        solution.merge(a,a.length,b,b.length);
    }
}